<?php

return array(
    'router' => array(
        'routes' => array(
            'user-admin' => array(
                'type' => 'Literal',
                'options' => array(
                    'route' => '/manager',
                    'defaults' => array(
                        'controller' => 'user-admin-controller',
                        'action' => 'login'
                    )
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'logout' => array(
                        'type' => 'Segment',
                        'options' => array(
                            'route' => '/logout',
                            'defaults' => array(
                                'controller' => 'user-admin-controller',
                                'action' => 'logout'
                            )
                        )
                    )
                )
            ),
            'product-admin' => array(
                'type' => 'Literal',
                'options' => array(
                    'route' => '/manager/product',
                    'defaults' => array(
                        'controller' => 'product-admin-controller',
                        'action' => 'list-product'
                    )
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'doaction' => array(
                        'type' => 'Segment',
                        'options' => array(
                            'route' => '/[:action][/:param]',
                            'constraints' => array(
                                'action' => '[a-z-]*',
                                'param' => '[0-9]*'
                            ),
                            'defaults' => array(
                            )
                        ),
                    ),
                    'paginator' => array(
                        'type' => 'Segment',
                        'options' => array(
                            'route' => '/list-product[/:cat_id][/:cat_filter][/page/:page_param]',
                            'constraints' => array(
                                'cat_id' => 'all|[0-9]*',
                                'page_param' => '[0-9]*',
                                'cat_filter' => '[a-z-]*'
                            ),
                            'defaults' => array(
                            )
                        ),
                    )
                )
            )
        )
    ),
    'controllers' => array(
        'invokables' => array(
            'user-admin-controller' => 'Admin\Controller\UserController',
            'product-admin-controller' => 'Admin\Controller\ProductController'
        )
    ),
    'view_manager' => array(
        'display_not_found_reason' => true,
        'display_exceptions' => true,
        'doctype' => 'HTML5',
        'not_found_template' => 'error/404',
        'exception_template' => 'error/index',
        'template_map' => array(
            'admin/layout' => __DIR__ . '/../view/layout/layout.phtml',
            'error/404' => __DIR__ . '/../view/error/404.phtml',
            'error/index' => __DIR__ . '/../view/error/index.phtml',
        ),
        'template_path_stack' => array(
            __DIR__ . '/../view',
        ),
    ),
);
